home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 2.00 Begin Form frmPassword BorderStyle = 3 'Fixed Double Caption = "Change Password" ClientHeight = 2085 ClientLeft = 2490 ClientTop = 2790 ClientWidth = 4695 Height = 2490 Left = 2430 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 2085 ScaleWidth = 4695 Top = 2445 Width = 4815 Begin CommandButton cmdCancel Cancel = -1 'True Caption = "Cancel" Height = 375 Left = 3360 TabIndex = 7 Top = 1560 Width = 1215 End Begin CommandButton cmdOK Caption = "OK" Default = -1 'True Height = 375 Left = 120 TabIndex = 6 Top = 1560 Width = 1215 End Begin TextBox txtRetype Enabled = 0 'False Height = 315 Left = 2160 MaxLength = 20 PasswordChar = "*" TabIndex = 5 Top = 1080 Width = 2415 End Begin TextBox txtNew Enabled = 0 'False Height = 315 Left = 2160 MaxLength = 20 PasswordChar = "*" TabIndex = 4 Top = 600 Width = 2415 End Begin TextBox txtOld Height = 315 Left = 2160 MaxLength = 20 PasswordChar = "*" TabIndex = 3 Top = 120 Width = 2415 End Begin Label lblRetype Caption = "Retype New Password:" Enabled = 0 'False Height = 195 Left = 120 TabIndex = 2 Top = 1140 Width = 1995 End Begin Label lblNew Caption = "New Password" Enabled = 0 'False Height = 195 Left = 120 TabIndex = 1 Top = 660 Width = 1695 End Begin Label lblOld Caption = "Old Password:" Height = 195 Left = 120 TabIndex = 0 Top = 180 Width = 1635 End Option Explicit Sub cmdCancel_Click () Unload Me End Sub Sub cmdOK_Click () Dim putback As String ' ' Validate the change of password ' If Password <> CalcPassnum((txtOld.Text)) Then MsgBox "The value for Old Password is not correct." & Chr$(13) & Chr$(13) & "Check your screen saver password, and then try again.", 16, "Change Password" txtNew.Text = "" txtRetype.Text = "" txtOld.SetFocus Exit Sub End If If txtNew.Text <> txtRetype.Text Then MsgBox "The Values for New Password and Retype New" & Chr$(13) & "Password do not match." & Chr$(13) & Chr$(13) & "Try again.", 16, "Change Password" txtNew.Text = "" txtRetype.Text = "" txtNew.SetFocus Exit Sub End If ' ' Write the password to the ini file ' Password = CalcPassnum((txtNew.Text)) If Password <> OldPassword Then putback = Format$(Password) Call PutIni(iniName, iniSection, "Password", putback) OldPassword = Password End If Unload Me End Sub Sub Form_Load () ' ' Enable the text boxes and lables as appropriate ' If Password > 0 Then txtOld.Enabled = True lblOld.Enabled = True txtNew.Enabled = False lblNew.Enabled = False txtRetype.Enabled = False lblRetype.Enabled = False Else txtOld.Enabled = False lblOld.Enabled = False txtNew.Enabled = True lblNew.Enabled = True txtRetype.Enabled = True lblRetype.Enabled = True End If CentreForm Me End Sub Sub txtNew_GotFocus () txtNew.SelStart = 0 txtNew.SelLength = Len(txtNew.Text) End Sub Sub txtNew_LostFocus () txtNew.Text = UCase$(txtNew.Text) End Sub Sub txtOld_Change () ' ' Enable the text boxes and lables as appropriate ' If Len(txtOld) > 0 Then txtNew.Enabled = True lblNew.Enabled = True txtRetype.Enabled = True lblRetype.Enabled = True Else txtNew.Enabled = False lblNew.Enabled = False txtRetype.Enabled = False lblRetype.Enabled = False End If End Sub Sub txtOld_GotFocus () txtOld.SelStart = 0 txtOld.SelLength = Len(txtOld.Text) End Sub Sub txtOld_LostFocus () txtOld.Text = UCase$(txtOld.Text) End Sub Sub txtRetype_GotFocus () txtRetype.SelStart = 0 txtRetype.SelLength = Len(txtRetype.Text) End Sub Sub txtRetype_LostFocus () txtRetype.Text = UCase$(txtRetype.Text) End Sub